package com.powernode.dataStructure;

import org.junit.jupiter.api.Test;

import java.time.Instant;

public class testBinarySearch {

    @Test
    void testBinarySearchBase() {
        int []a = {1,2,3,4,5,6,7,8,9,10};
        int target = 5;
        System.out.println("binarySearchBase(a,target) = " + BinarySearch.binarySearchBase(a, target));

    }
    @Test
    void testBinarySearchBase2() {
        int []a = {1,2,3,4,5,6,7,8,9,10};
        int target = -3;
        System.out.println("binarySearchBase(a,target) = " + BinarySearch.binarySearchBase2(a, target));
    }
    @Test
    void binarySearchLeftMost() {
        int []a = {1,2,3,3,4,6,7,8,9,10};
        int target = 3;
        System.out.println("binarySearchBase(a,target) = " + BinarySearch.binarySearchLeftMost(a, target));
    }
    @Test
    void binarySearchRightMost() {
        int []a = {1,2,3,3,4,6,7,8,9,10};
        int target = 3;
        System.out.println("binarySearchBase(a,target) = " + BinarySearch.binarySearchRightMost(a, target));
    }

    @Test
    void binarySearchReturnInsertPoint() {
        int []a = {1,2,3,3,4,6,7,8,9,10};
        int target = -1;
        System.out.println("BinarySearch.binarySearchReturnInsertPoint(a,target) = " + BinarySearch.binarySearchReturnInsertPoint(a, target));
    }

}
